package com.zzb.projectfactory.framework.common;

import com.zzb.projectfactory.framework.autodoc.annotation.AutoDocField;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

/**
 * 基本实体
 * Created by 瑱彬 on 2016/9/18.
 */
@MappedSuperclass
public abstract class BaseEntity implements Serializable {
    @Transient
    private static final long serialVersionUID = 1L;
    @Id
    @GenericGenerator(name="idGenerator", strategy="uuid2") //这个是hibernate的注解/生成32位UUID
    @GeneratedValue(generator="idGenerator")
    @AutoDocField(value = "id")
    private String id;

    @Column(name = "creator")
    @AutoDocField(value = "创建人")
    private String creator;
    @Column(name = "updater")
    @AutoDocField(value = "更新人")
    private String updater;
    @Column(name = "create_time")
    @AutoDocField(value = "创建时间")
    private Date createTime;
    @Column(name = "update_time")
    @AutoDocField(value = "更新时间")
    private Date updateTime;
    @Column(name = "activate")
    @AutoDocField(value = "是否激活")
    private Boolean activate;

    public String getCreator() {
        return creator;
    }
    public void setCreator(String creator) {
        this.creator = creator;
    }
    public String getUpdater() {
        return updater;
    }
    public void setUpdater(String updater) {
        this.updater = updater;
    }
    public Date getCreateTime() {
        return createTime;
    }
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
    public Date getUpdateTime() {
        return updateTime;
    }
    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }
    public Boolean getActivate() {
        return activate;
    }
    public void setActivate(Boolean activate) {
        this.activate = activate;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

}
